package net.rlair.sbdemo.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.Ordered;

@Aspect
public class YangHaikunAspect2 implements Ordered{
    @Pointcut ("execution(* net.rlair.sbdemo.controller.ZhaozichenController.list())")
    public void list() {

    }

    @AfterReturning(value = "list()")
    public void afterReturning() {
        System.out.println("after list returning....");
    }

    @Around(value = "list()")
    public Object around(ProceedingJoinPoint jp) throws Throwable {
        System.out.println("before around list...");
        Object obj = jp.proceed();
        System.out.println("after around list...");
        return obj;
    }

    @Override
    public int getOrder() {
        return 2;
    }
}
